<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />
		
		<title>JsDoc Reference - $.js.Array</title>

		<style type="text/css">
			/* default.css */
body
{
	font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
	width: 800px;
}

.header
{
	clear: both;
	background-color: #ccc;
	padding: 8px;
}

h1
{
	font-size: 150%;
	font-weight: bold;
	padding: 0;
	margin: 1em 0 0 .3em;
}

hr
{
	border: none 0;
	border-top: 1px solid #7F8FB1;
	height: 1px;
}

pre.code
{
	display: block;
	padding: 8px;
	border: 1px dashed #ccc;
}

#index
{
	margin-top: 24px;
	float: left;
	width: 160px;
	position: absolute;
	left: 8px;
	background-color: #F3F3F3;
	padding: 8px;
}

#content
{
	margin-left: 190px;
	width: 600px;
}

.classList
{
	list-style-type: none;
	padding: 0;
	margin: 0 0 0 8px;
	font-family: arial, sans-serif;
	font-size: 1em;
	overflow: auto;
}

.classList li
{
	padding: 0;
	margin: 0 0 8px 0;
}

.summaryTable { width: 100%; }

h1.classTitle
{
	font-size:170%;
	line-height:130%;
}

h2 { font-size: 110%; }
caption, div.sectionTitle
{
	background-color: #7F8FB1;
	color: #fff;
	font-size:130%;
	text-align: left;
	padding: 2px 6px 2px 6px;
	border: 1px #7F8FB1 solid;
}

div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }

.summaryTable td
{
	vertical-align: top;
	padding: 4px;
	border-bottom: 1px #7F8FB1 solid;
	border-right: 1px #7F8FB1 solid;
}

/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
	border-left: 1px #7F8FB1 solid;
	width: 140px;
	text-align: right;
}

td.attributes, .fixedFont
{
	line-height: 15px;
	color: #002EBE;
	font-family: "Courier New",Courier,monospace;
	font-size: 13px;
}

.summaryTable td.nameDescription
{
	text-align: left;
	font-size: 13px;
	line-height: 15px;
}

.summaryTable td.nameDescription, .description
{
	line-height: 15px;
	padding: 4px;
	padding-left: 4px;
}

.summaryTable { margin-bottom: 8px; }

ul.inheritsList
{
	list-style: square;
	margin-left: 20px;
	padding-left: 0;
}

.detailList {
	margin-left: 20px; 
	line-height: 15px;
}
.detailList dt { margin-left: 20px; }

.detailList .heading
{
	font-weight: bold;
	padding-bottom: 6px;
	margin-left: 0;
}

.light, td.attributes, .light a:link, .light a:visited
{
	color: #777;
	font-style: italic;
}

.fineprint
{
	text-align: right;
	font-size: 10px;
}
		</style>
	</head>

	<body>
<!-- ============================== header ================================= -->	
		<!-- begin static/header.html -->
		<div id="header">
</div>
		<!-- end static/header.html -->

<!-- ============================== classes index ============================ -->
		<div id="index">
			<!-- begin publish.classesIndex -->
			<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
	
	<li><a href="../symbols/%24.html">$</a></li>
	
	<li><a href="../symbols/%24.browser.html">$.browser</a></li>
	
	<li><a href="../symbols/%24.dom.html">$.dom</a></li>
	
	<li><a href="../symbols/%24.dom.DOMTokenList.html">$.dom.DOMTokenList</a></li>
	
	<li><a href="../symbols/%24.dom.Element.html">$.dom.Element</a></li>
	
	<li><a href="../symbols/%24.dom.HTMLElement.html">$.dom.HTMLElement</a></li>
	
	<li><a href="../symbols/%24.dom.KeyboardEvent.html">$.dom.KeyboardEvent</a></li>
	
	<li><a href="../symbols/%24.dom.KeyboardEventListener.html">$.dom.KeyboardEventListener</a></li>
	
	<li><a href="../symbols/%24.dom.keyCodes.html">$.dom.keyCodes</a></li>
	
	<li><a href="../symbols/%24.dom.keyCodes_fixes.html">$.dom.keyCodes_fixes</a></li>
	
	<li><a href="../symbols/%24.dom.keyCodes_Safari2.html">$.dom.keyCodes_Safari2</a></li>
	
	<li><a href="../symbols/%24.dom.keyNames.html">$.dom.keyNames</a></li>
	
	<li><a href="../symbols/%24.dom.Node.html">$.dom.Node</a></li>
	
	<li><a href="../symbols/%24.dom.NodeList.html">$.dom.NodeList</a></li>
	
	<li><a href="../symbols/%24.js.html">$.js</a></li>
	
	<li><a href="../symbols/%24.js.Array.html">$.js.Array</a></li>
	
	<li><a href="../symbols/%24.js.Object.html">$.js.Object</a></li>
	
	<li><a href="../symbols/%24.js.String.html">$.js.String</a></li>
	
	<li><a href="../symbols/%24.profiler.html">$.profiler</a></li>
	
	<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
	
</ul>
<hr />
			<!-- end publish.classesIndex -->
		</div>
		
		<div id="content">
<!-- ============================== class title ============================ -->
			<h1 class="classTitle">
				
				Namespace $.js.Array
			</h1>

<!-- ============================== class summary ========================== -->			
			<p class="description">
				
			
				Holds the methods used for manipulating arrays and other 
array-like objects.
				
				
					<br /><i>Defined in: </i> <a href="../symbols/src/src_core-js.js.html">core-js.js</a>.
				
			</p>

<!-- ============================== constructor summary ==================== -->			
			
			<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class $.js.Array.">
				<caption>Namespace Summary</caption>
				<thead>
					<tr>
						<th scope="col">Constructor Attributes</th>
						<th scope="col">Constructor Name and Description</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="attributes">&nbsp;</td>
						<td class="nameDescription" >
							<div class="fixedFont">
								<b><a href="../symbols/%24.js.Array.html">$.js.Array</a></b>
							</div>
							<div class="description">Holds the methods used for manipulating arrays and other array-like objects.</div>
						</td>
					</tr>
				</tbody>
			</table>
			

<!-- ============================== properties summary ===================== -->
			

<!-- ============================== methods summary ======================== -->
			
				
				
				<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class $.js.Array.">
					<caption>Method Summary</caption>
					<thead>
						<tr>
							<th scope="col">Method Attributes</th>
							<th scope="col">Method Name and Description</th>
						</tr>
					</thead>
					<tbody>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.concat">concat</a></b>(value1, valueN)
								</div>
								<div class="description">Concatenate multiple arrays.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.every">every</a></b>(callback, thisObject)
								</div>
								<div class="description">Check if the <var>callback</var> function returns true for every element in 
the current array.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.filter">filter</a></b>(callback, thisObject)
								</div>
								<div class="description">Filter the current array using the <var>callback</var> function.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.forEach">forEach</a></b>(callback, thisObject)
								</div>
								<div class="description">Execute the <var>callback</var> function for each element in the current 
array.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.indexOf">indexOf</a></b>(value, offset)
								</div>
								<div class="description">Return the first index where the given value is found in the current array.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.join">join</a></b>(separator)
								</div>
								<div class="description">Join all the elements from the current array into a single string using 
a separator.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.lastIndexOf">lastIndexOf</a></b>(value, offset)
								</div>
								<div class="description">Return the last index where the given value is found in the current array.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.map">map</a></b>(callback, thisObject)
								</div>
								<div class="description">Create a new array with the same length as the current array using the 
values returned by the <var>callback</var> function.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.reduce">reduce</a></b>(callback, initialValue)
								</div>
								<div class="description">Apply the <var>callback</var> function to two values from the current 
array, from left to right, simultaneously, for the purpose of reducing the 
array to a single value.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.reduceRight">reduceRight</a></b>(callback, initialValue)
								</div>
								<div class="description">Apply the <var>callback</var> function to two values from the current 
array, from right to left, simultaneously, for the purpose of reducing the 
array to a single value.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.slice">slice</a></b>(begin, end)
								</div>
								<div class="description">Extract a section of the current array and return it.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">$.js.Array.<b><a href="../symbols/%24.js.Array.html#.some">some</a></b>(callback, thisObject)
								</div>
								<div class="description">Check if the <var>callback</var> function returns true for at least one 
element in the current array.</div>
							</td>
						</tr>
					
					</tbody>
				</table>
				
				
				
			
<!-- ============================== events summary ======================== -->
			

<!-- ============================== constructor details ==================== -->		
			
			<div class="details"><a name="constructor"> </a>
				<div class="sectionTitle">
					Namespace Detail
				</div>
				
				<div class="fixedFont">
						<b>$.js.Array</b>
				</div>
				
				<div class="description">
					Holds the methods used for manipulating arrays and other array-like objects.

<p>These methods are very similar to their Object counter-parts. Also, most 
of the methods (if not all) are already implemented natively in the global 
<var>Array.prototype</var> object (new in JavaScript 1.6).

<p>By default, the global <var>Array.prototype</var> object is extended to 
contain all the methods in this namespace, if they do not exists already.  
Thus, native Array methods are not overwritten.

<p>All of these methods use their <var>this</var> object. As such, you need 
to pass the correct <var>this</var> object.

<p>Note that the methods provided iterate over the object properties using 
<code>for (var <var>i</var> = 0; <var>i</var> &lt; <var>this</var>.length; 
<var>i</var>++) { ... <var>this[i]</var> ... }</code>. As such, any object 
can be used if it provides index-based access to its properties, together 
with the <var>length</var> property. 

<p>The implementations do minimal type checks, such that the methods can be 
used together with NodeLists and other Array-like objects.

<p>In the examples provided for each method we will assume that the arrays 
defined already have the methods. Thus code like 
<code><var>array</var>.filter(<var>callback</var>)</code> can be written 
directly.
					
				</div>
				
				
				
				<pre class="code">// To use these methods with a NodeList proceed as follows:

<code>var <var>nodes</var> = document.body.childNodes;

$.js.Array.forEach.call(<var>nodes</var>, function (<var>node</var>) {
  // ...
});</code>

// Instead of forEach, you can use any of the methods defined in this
// namespace.</pre>
				
				<pre class="code">Additionally, you can extend your object to have all these methods:

<code>$.extend.call(NodeList, $.js.Array);</code>

// After doing so, you can directly use any desired method.
// For example:
<code><var>nodes</var>.forEach(<var>callback</var>)</code>.</pre>
				
				
				
				
					
					
					
					
					
					
					
						<dl class="detailList">
						<dt class="heading">See:</dt>
						
							<dd><a href="../symbols/%24.js.Object.html">$.js.Object</a> The Object methods which provide similar functionality for 
objects.</dd>
						
						</dl>
					

			</div>
			

<!-- ============================== field details ========================== -->		
			

<!-- ============================== method details ========================= -->		
			
				<div class="sectionTitle">
					Method Detail
				</div>
				
					<a name=".concat"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Array}</span>
					<span class="light">$.js.Array.</span><b>concat</b>(value1, valueN)
					
					</div>
					<div class="description">
						Concatenate multiple arrays.

<p>This method takes any number of arguments.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr1</var> = [5, 11, 7];
var <var>arr2</var> = <var>arr1</var>.concat('test', [1, 2, 3], 4);</code>

// Now <code><var>arr2</var> = [5, 11, 7, 'test', 1, 2, 3, 4]</code>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<b>value1</b>
									
								</dt>
								<dd>Array/value to concatenate.</dd>
							
								<dt>
									<b>valueN</b>
									<i>Optional</i>
								</dt>
								<dd>Array/value to concatenate.</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Array}</span> The result is a new array consisting of:
<ol>
  <li>the <var>this</var> array object on which the <code>concat</code> 
  method was called;
  <li>each element of the arrays passed as arguments;
  <li>if an argument is not an array, then the argument value is added 
  as-is.
</ol>

<p>The current array is not altered, nor the arrays passed as arguments.</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".every"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Boolean}</span>
					<span class="light">$.js.Array.</span><b>every</b>(callback, thisObject)
					
					</div>
					<div class="description">
						Check if the <var>callback</var> function returns true for every element in 
the current array.

<p>The <var>callback</var> function is invoked for each element in the 
current array, and it is given three arguments: the value, the index, and 
the entire array being iterated over.

<p>Iteration over the array stops once reaching the end, or once the 
<var>callback</var> function returns false.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = [10, 11, 12];</code>

// The following returns true.
<code><var>arr</var>.every(function (<var>value</var>) {
  return <var>value</var> &gt; 9;
});</code></pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
traversing the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>thisObject</b>
									<i>Optional</i>
								</dt>
								<dd>The object which will be the <var>this</var> 
within the scope of the <var>callback</var> function, for each invocation.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Boolean}</span> False is returned if the <var>callback</var> returns 
false once. Otherwise, this method returns true.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Object.html#.every">$.js.Object.every</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".filter"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Array}</span>
					<span class="light">$.js.Array.</span><b>filter</b>(callback, thisObject)
					
					</div>
					<div class="description">
						Filter the current array using the <var>callback</var> function.

<p>The <var>callback</var> function is invoked for each element in the 
current array, and it is given three arguments: the value, the index, and 
the entire array being iterated over.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr1</var> = [5, 11, 7];</code>

// Filter only the elements with a value lower than 10:

<code>var <var>arr2</var> = <var>arr1</var>.filter(
  function (<var>value</var>, <var>index</var>, <var>array</var>) {
    return <var>value</var> &lt; 10;
  }
);</code>

// Now <code><var>arr2</var> = [5, 7]</code>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
filtering the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>thisObject</b>
									<i>Optional</i>
								</dt>
								<dd>The object which will be the <var>this</var> 
within the scope of the <var>callback</var> function, for each invocation.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Array}</span> The new array contains only the elements for which the 
<var>callback</var> function returned true.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Object.html#.filter">$.js.Object.filter</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".forEach"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">$.js.Array.</span><b>forEach</b>(callback, thisObject)
					
					</div>
					<div class="description">
						Execute the <var>callback</var> function for each element in the current 
array.

<p>The <var>callback</var> function is invoked with three arguments: the 
value, the index, and the entire array being iterated over.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = [10, 11, 12];</code>

// alert() each index and value.
<code><var>arr</var>.forEach(
  function (<var>value</var>, <var>index</var>) {
    alert(<var>index</var> + ' : ' + <var>value</var>);
  }
);</code></pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
traversing the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>thisObject</b>
									<i>Optional</i>
								</dt>
								<dd>The object which will be the <var>this</var> 
within the scope of the <var>callback</var> function, for each invocation.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Object.html#.forEach">$.js.Object.forEach</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".indexOf"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Number}</span>
					<span class="light">$.js.Array.</span><b>indexOf</b>(value, offset)
					
					</div>
					<div class="description">
						Return the first index where the given value is found in the current array.

<p>Note that the method uses strict comparison for finding the value 
(<code>===</code>).
						
						
					</div>
					
					
					
					<pre class="code"><code>var arr = ['a', 'b', 'c', 'd', 'b'];
arr.indexOf('b');</code>
// Returns 1.

<code>arr.indexOf('b', 2);</code>
// Returns 4.

<code>arr.indexOf('b', -2);</code>
// Returns 4.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<b>value</b>
									
								</dt>
								<dd>The value you want to find in the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>offset</b>
									<i>Optional, Default: 0</i>
								</dt>
								<dd>Zero-based index from where to start searching 
the array.

<p>If the argument is not given, the entire array is searched.

<p>If the number is negative, then the <var>offset</var> is considered to 
be an offset from the end of the array. Thus, given a negative index like 
-3, it would mean that only the last three elements are checked.

<p>The method always starts searching from the calculated/given 
<var>offset</var> increasing one by one up to the array length (forward 
search).</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>value</var> is undefined.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Number}</span> The element index where the first occurrence of 
<var>value</var> was found in the current array. If the value was not 
found, -1 is returned.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Array.html#.lastIndexOf">$.js.Array.lastIndexOf</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".join"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{String}</span>
					<span class="light">$.js.Array.</span><b>join</b>(separator)
					
					</div>
					<div class="description">
						Join all the elements from the current array into a single string using 
a separator.

<p>Each element of the array is converted to a string using the automatic 
<code>toString()</code> method invocation. A string separator is added into 
the result string between each array element.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = ['a', 'b', 'c'];
var <var>str</var> = <var>arr</var>.join('-');</code>

// Now <code><var>str</var> = 'a-b-c'</code>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>separator</b>
									<i>Optional</i>
								</dt>
								<dd>The separator string which gets added between 
each array element into the result string. If the argument is not provided, 
then a comma will be used.</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> The new string containing all the elements in the current 
array, converted into strings, separated by the given <var>separator</var>.</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".lastIndexOf"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Number}</span>
					<span class="light">$.js.Array.</span><b>lastIndexOf</b>(value, offset)
					
					</div>
					<div class="description">
						Return the last index where the given value is found in the current array.

<p>Note that the method uses strict comparison for finding the value 
(<code>===</code>).
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = ['a', 'b', 'c', 'd', 'b'];
<var>arr</var>.lastIndexOf('b');</code>
// Returns 4.

<code><var>arr</var>.lastIndexOf('b', 2);</code>
// Returns 1.

<code><var>arr</var>.lastIndexOf('b', -2);</code>
// Returns 1.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<b>value</b>
									
								</dt>
								<dd>The value you want to find in the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>offset</b>
									<i>Optional, Default: this.length</i>
								</dt>
								<dd>Zero-based index from where to start 
searching backwards.

<p>If the argument is not given, the entire array is searched.

<p>If the number is negative, then the <var>offset</var> is considered to 
be an offset from the end of the array. Thus, given a negative index like 
-3, it would mean that the last <strong>two</strong> elements are 
 <strong>not</strong> checked.

<p>The method always starts searching from the calculated/given 
<var>offset</var> decreasing one by one, down to index 0 (backwards 
search).</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>value</var> is undefined.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Number}</span> The element index where the last occurrence of 
<var>value</var> was found in the current array. If the value was not 
found, -1 is returned.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Array.html#.indexOf">$.js.Array.indexOf</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".map"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Array}</span>
					<span class="light">$.js.Array.</span><b>map</b>(callback, thisObject)
					
					</div>
					<div class="description">
						Create a new array with the same length as the current array using the 
values returned by the <var>callback</var> function.

<p>The <var>callback</var> function is invoked for each element in the 
current array, and it is given three arguments: the value, the index, and 
the entire array being iterated over.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr1</var> = [5, 11, 7];</code>

// Let's double the numbers:
<code>var <var>arr2</var> = <var>arr1</var>.map(function (<var>value</var>) {
  return <var>value</var> * 2;
});</code>

// Now <code><var>arr2</var> = [10, 22, 14]</code>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
traversing the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>thisObject</b>
									<i>Optional</i>
								</dt>
								<dd>The object which will be the <var>this</var> 
within the scope of the <var>callback</var> function, for each invocation.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Array}</span> The new array has the same length as the current array, 
but the values are those returned by the <var>callback</var> function.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Object.html#.map">$.js.Object.map</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".reduce"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">$.js.Array.</span><b>reduce</b>(callback, initialValue)
					
					</div>
					<div class="description">
						Apply the <var>callback</var> function to two values from the current 
array, from left to right, simultaneously, for the purpose of reducing the 
array to a single value.

<p>The <var>callback</var> function is called for each element in the 
current array, and it is given four arguments: the previous value, the 
current value, the current index, and the entire array being iterated over.

<p>This method does not alter the current array.

<p>Iteration starts from the first element in the current array (index 0) 
going up to the last element (<code>array.length-1</code>), one by one.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = [5, 10, 6];</code>

// Let's calculate the sum:
<code>var <var>result</var> = <var>arr</var>.reduce(
  function (<var>sum</var>, <var>value</var>) {
    return <var>sum</var> + <var>value</var>;
  },
0);</code>

// Now <var>result</var> = 21.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
traversing the current array.</dd>
							
								<dt>
									<b>initialValue</b>
									<i>Optional</i>
								</dt>
								<dd>The initial value used when the <var>callback</var> 
function is first invoked. If the initial value is not provided, then the 
method uses the value of the first element found in the array being 
iterated.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd>The result of the last <var>callback</var> function invocation.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Array.html#.reduceRight">$.js.Array.reduceRight</a></dd>
							
								<dd><a href="../symbols/%24.js.Object.html#.reduce">$.js.Object.reduce</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".reduceRight"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">$.js.Array.</span><b>reduceRight</b>(callback, initialValue)
					
					</div>
					<div class="description">
						Apply the <var>callback</var> function to two values from the current 
array, from right to left, simultaneously, for the purpose of reducing the 
array to a single value.

<p>The <var>callback</var> function is called for each element in the 
current array, and it is given four arguments: the previous value, the 
current value, the current index, and the entire array being iterated over.

<p>This method does not alter the current array.

<p>Iteration starts from the last element in the current array 
(<code>array.length-1</code>) going down to 0, the first element, one by 
one.
						
						
					</div>
					
					
					
					<pre class="code"><code>var arr = [5, 10, 6];</code>

// Let's calculate the sum:
<code>var result = arr.reduce(function (<var>sum</var>, <var>value</var>) {
  return <var>sum</var> + <var>value</var>;
}, 0);</code>

// Now result = 21.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The callback function used for traversing the 
current array.</dd>
							
								<dt>
									<b>initialValue</b>
									<i>Optional</i>
								</dt>
								<dd>The initial value used when the <var>callback</var> 
function is first invoked. If the initial value is not provided, then the 
method uses the value of the last element found in the array being 
iterated.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd>The result of the last <var>callback</var> function invocation.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Array.html#.reduce">$.js.Array.reduce</a></dd>
							
								<dd><a href="../symbols/%24.js.Object.html#.reduce">$.js.Object.reduce</a></dd>
							
							</dl>
						

					<hr />
				
					<a name=".slice"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Array}</span>
					<span class="light">$.js.Array.</span><b>slice</b>(begin, end)
					
					</div>
					<div class="description">
						Extract a section of the current array and return it.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr1</var> = ['a', 'b', 'c', 'd'];
var <var>arr2</var> = <var>arr1</var>.slice(1, 3);</code>
// Now <code><var>arr2</var> = ['b', 'c']</code>.

<code>var <var>arr3</var> = <var>arr1</var>.slice(1);</code>
// Now <code><var>arr3</var> = ['b', 'c', 'd']</code>.

<code>var <var>arr4</var> = <var>arr1</var>.slice(0, -2);</code>
// Now <code><var>arr4</var> = ['a', 'b']</code>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>begin</b>
									
								</dt>
								<dd>Zero-based index from where to start the extraction 
of array elements.</dd>
							
								<dt>
									<span class="light fixedFont">{Number}</span> <b>end</b>
									<i>Optional, Default: this.length</i>
								</dt>
								<dd>Zero-based index where to end the 
extraction of array elements.

<p>If the argument is not given, then the end is considered the array 
length. Thus, the slice being extracted contains all the array elements 
from the given <var>begin</var> index.

<p>If the number is negative, then the <var>end</var> index is calculated 
by a simple formula: <code><var>end</var> = <var>array.length</var> 
- <var>end</var></code>. Thus, given a negative index like -3, it would 
  mean that the slice being extracted will not contain the last three 
  elements.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>begin</var> is not a number, or if it is 
a negative number.</dd>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>end</var> is provided, but it is not a number.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Array}</span> The new array returned contains all the elements starting 
from the <var>begin</var> index (including it) up to the <var>end</var> 
index (excluding it).</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".some"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Boolean}</span>
					<span class="light">$.js.Array.</span><b>some</b>(callback, thisObject)
					
					</div>
					<div class="description">
						Check if the <var>callback</var> function returns true for at least one 
element in the current array.

<p>The <var>callback</var> function is invoked for each element in the 
current array, and it is given three arguments: the value, the index, and 
the entire array being iterated over.

<p>Iteration over the array stops once reaching the end, or once the 
<var>callback</var> function returns true.

<p>This method does not alter the current array.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>arr</var> = [10, 11, 12];</code>

// The following returns true.
<code><var>arr</var>.some(function (<var>value</var>) {
  return <var>value</var> &gt; 11;
});</code></pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>callback</b>
									
								</dt>
								<dd>The <var>callback</var> function used for 
traversing the current array.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>thisObject</b>
									<i>Optional</i>
								</dt>
								<dd>The object which will be the <var>this</var> 
within the scope of the <var>callback</var> function, for each invocation.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If <var>callback</var> is not a function.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Boolean}</span> True is returned if the <var>callback</var> returns true 
once. Otherwise, this method returns false.</dd>
							
							</dl>
						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
								<dd><a href="../symbols/%24.js.Object.html#.some">$.js.Object.some</a></dd>
							
							</dl>
						

					
				
			
			
<!-- ============================== event details ========================= -->		
			
			
			<hr />
		</div>

		
<!-- ============================== footer ================================= -->
		<div class="fineprint" style="clear:both">
			
			Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon May 11 2009 19:36:23 GMT+0300 (EEST)
		</div>
	</body>
</html>
